import React from "react";
import "./style.css"

interface PropsType {
  v: {
    uid: number;
    id: string;
    url: string;
    title: string;
    desc: string;
    greter: number;
    zan: boolean;
  };
	onClick?: () => void
}

const Index: React.FC<PropsType> = ({v, onClick}) => {
  return (
    <dl
      key={v.id}
      className="list-item"
      onClick={ onClick }
    >
      <dt>
        <img src={v.url} alt="" />
      </dt>
      <dd>
        <h3>{v.title}</h3>
        <p>{v.desc}</p>
        <div>
          <span style={{ color: v.zan ? "red" : "#000" }}>赞：{v.greter}</span>
        </div>
      </dd>
    </dl>
  );
};

export default Index;
